<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j"
    template="/layout/template.xhtml">

    <ui:define name="l_content">
		<ui:include src="/l_content/lc.xhtml" />
    </ui:define>
    
    <ui:define name="body">
    	<h:form>
	    	<h:panelGroup id="order_id">
	    		<h:commandButton action="my_account" value="#{messages.back_msg}" immediate="true"/>
	    		<br />
	    		<rich:dataTable value="#{kMyOrder.orderList}" var="o" rows="5" >
	    			<rich:column>
	    				<rich:dataTable value="#{o.items}" var="e">
	    					<f:facet name="header" >
		    					<rich:columnGroup >
		    						<rich:column colspan="9">
		    							<h:outputText value="#{o.order.created}" >
		    								<f:convertDateTime pattern="dd.MM.yyyy HH:mm"/>
		    							</h:outputText>
		    							<h:outputText value=" - #{o.order.status}" />
		    						</rich:column>
		    					</rich:columnGroup>
	    					</f:facet>
	    					<rich:column>
			   					<f:facet name="header">
			   						<h:outputText value="#{messages.img_msg}" />
			   					</f:facet>
			   					<a href="#{facesContext.externalContext.requestContextPath}/k_item.k?itemId=#{e.orderItem.item.id}" >
			  						<img src="/#{kInitParam.imgPath}/i_#{e.img.itemId}/#{e.img.name}" width="50" height="50"/>
			   					</a>
			   				</rich:column>
	    					<rich:column>
	    						<f:facet name="header">
	    							<h:outputText value="#{messages.item_msg}" />
	    						</f:facet>
	   							<h:outputText value="#{e.orderItem.item.getName(kUser.klang)}" />    						
	    					</rich:column>
	    					<rich:column>
	    						<f:facet name="header">
	    							<h:outputText value="#{messages.color_msg}" />
	    						</f:facet>
	   							<h:outputText value="#{e.orderItem.itemColor}" />
	    					</rich:column>
	    					<rich:column>
	    						<f:facet name="header">
	    							<h:outputText value="#{messages.size_msg}" />
	    						</f:facet>
	   							<h:outputText value="#{e.orderItem.itemSize}" />
	    					</rich:column>
	    					<rich:column>
	    						<f:facet name="header">
	    							<h:outputText value="#{messages.material_msg}" />
	    						</f:facet>
	   							<h:outputText value="#{e.orderItem.itemMaterial}" />
	    					</rich:column>
	    					<rich:column>
	    						<f:facet name="header">
	    							<h:outputText value="#{messages.kadrons_msg}" />
	    						</f:facet>
	   							<h:outputText value="#{e.orderItem.kadrons} K" />    						
	    					</rich:column>
	    					<rich:column>
	    						<f:facet name="header">
	    							<h:outputText value="#{messages.price_msg}" />
	    						</f:facet>
	   							<h:outputText value="#{e.orderItem.price} #{o.order.currency.sign}" />    						
	    					</rich:column>
	    					<rich:column>
	    						<f:facet name="header">
	    							<h:outputText value="#{messages.discount_price_msg}" />
	    						</f:facet>
	   							<h:outputText value="#{e.orderItem.discountPrice} #{o.order.currency.sign}" />    						
	    					</rich:column>
	    					<rich:column>
	    						<f:facet name="header">
	    							<h:outputText value="#{messages.your_price_msg}" />
	    						</f:facet>
	   							<h:outputText value="#{e.orderItem.yourPrice} #{o.order.currency.sign}" />    						
	    					</rich:column>
	    					<rich:column>
	    						<f:facet name="header">
	    							<h:outputText value="#{messages.quantity_msg}" />
	    						</f:facet>
	   							<h:outputText value="#{e.orderItem.quantity}" />    						
	    					</rich:column>
	    					<rich:column>
			    				<f:facet name="header">
			    					<h:outputText value="#{messages.sum_msg}" />
			    				</f:facet>
			    				<h:outputText value="#{e.orderItem.sum} #{o.order.currency.sign}" />
			    			</rich:column>
	    					<f:facet name="footer">
			    				<rich:columnGroup>
			    					<rich:column colspan="12" style="text-align:right;">
		    							<h:outputText value="#{messages.total_msg} = " />
		    							<h:outputText value="#{o.total} #{o.order.currency.sign}" />
		    						</rich:column>
			    				</rich:columnGroup>
			    			</f:facet>
	    				</rich:dataTable>
	    			</rich:column>
	    			<f:facet name="footer">
	    				<rich:datascroller />
	    			</f:facet>
	    		</rich:dataTable>
	    	</h:panelGroup>
    	</h:form>
    </ui:define>
</ui:composition>
